From 7b2717cda8f504c6f2aba9c657ce4a1a0d1f9d42 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 23 Dec 2022 15:43:27 +0100 Subject: [PATCH] [PATCH] CppunitTest_sc_subsequent_filters_test2: fix test depending on current year While at it, move the file from ods to fods for better tracking in git Change-Id: I16df221e3a7341dc7c53de6130158c3887c472a6 Gbp-Pq: Name fix-Tdf126116-test.diff --- sc/qa/unit/data/fods/tdf126116.fods | 170 ++++++++++++++++++++++++ sc/qa/unit/subsequent_filters-test2.cxx | 7 +- 2 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 sc/qa/unit/data/fods/tdf126116.fods diff --git a/sc/qa/unit/data/fods/tdf126116.fods b/sc/qa/unit/data/fods/tdf126116.fods new file mode 100644 index 00000000000..2db351642f7 --- /dev/null +++ b/sc/qa/unit/data/fods/tdf126116.fods @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ??? + + + + + Page 1 + + + + + + + + ???(???) + + + 00/00/0000, 00:00:00 + + + + + + Page 1/ 99 + + + + + + + + + + + + + + 02/02/21 + + + 21 + + + + + + + diff --git a/sc/qa/unit/subsequent_filters-test2.cxx b/sc/qa/unit/subsequent_filters-test2.cxx index 9c15eebfff0..18a571e0853 100644 --- a/sc/qa/unit/subsequent_filters-test2.cxx +++ b/sc/qa/unit/subsequent_filters-test2.cxx @@ -1357,7 +1357,7 @@ void ScFiltersTest2::testTdf103734() void ScFiltersTest2::testTdf126116() { - ScDocShellRef xDocSh = loadDoc(u"tdf126116.", FORMAT_ODS); + ScDocShellRef xDocSh = loadDoc(u"tdf126116.", FORMAT_FODS); CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is()); ScDocument& rDoc = xDocSh->GetDocument(); @@ -1365,10 +1365,13 @@ void ScFiltersTest2::testTdf126116() rDoc.SetString(ScAddress(0, 0, 0), "03/03"); + // Get the current year from B1 with format YY + OUString aYear = rDoc.GetString(ScAddress(1, 0, 0)); + // Without the fix in place, this test would have failed with // - Expected: 03/03/21 // - Actual : 03/03/2021 - CPPUNIT_ASSERT_EQUAL(OUString("03/03/21"), rDoc.GetString(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(OUString("03/03/" + aYear), rDoc.GetString(ScAddress(0, 0, 0))); xDocSh->DoClose(); } -- 2.30.2